////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_MATH_CIRCLE_H__
#define __WN_MATH_CIRCLE_H__

#include "WNCore/inc/WNTypes.h"
#include "WNMath/inc/WNPoint2.h"

namespace WNMath {
    class WNBounds2;
    class WNRectangle;
    class WNVector2;

    class WNCircle {
    public:
        WNCircle();
        explicit WNCircle(const WN_FLOAT32* _f);
        explicit WNCircle(const WNPoint2& _location, WN_FLOAT32 _radius);
        explicit WNCircle(WN_FLOAT32 _x, WN_FLOAT32 _y, WN_FLOAT32 _radius);

        WN_BOOL operator == (const WNCircle& _circle) const;
        WN_BOOL operator != (const WNCircle& _circle) const;

        WN_VOID Zero();
        WN_VOID Expand(WN_FLOAT32 _amount);
        WN_BOOL Expand(const WNPoint2& _point, WN_BOOL _anchor = WN_FALSE);
        WN_BOOL Expand(const WNRectangle& _rectangle, WN_BOOL _anchor = WN_FALSE);
        WN_BOOL Expand(const WNBounds2& _bounds, WN_BOOL _anchor = WN_FALSE);
        WN_BOOL Expand(const WNCircle& _circle, WN_BOOL _anchor = WN_FALSE);
        WN_VOID Translate(const WNVector2& _vector);

        WN_FLOAT32 Circumference() const;
        WN_FLOAT32 Area() const;

        WN_BOOL IsZero() const;
        WN_BOOL IsInsideOut() const;

        WN_VOID Set(const WN_FLOAT32* _f);
        WN_VOID Set(const WNPoint2& _location, WN_FLOAT32 _radius);
        WN_VOID Set(WN_FLOAT32 _x, WN_FLOAT32 _y, WN_FLOAT32 _radius);

        WNCircle GetExpanded(WN_FLOAT32 _amount) const;
        WNCircle GetExpanded(const WNPoint2& _point, WN_BOOL _anchor = WN_FALSE) const;
        WNCircle GetExpanded(const WNRectangle& _rectangle, WN_BOOL _anchor = WN_FALSE) const;
        WNCircle GetExpanded(const WNCircle& _circle, WN_BOOL _anchor = WN_FALSE) const;
        WNCircle GetTranslated(const WNVector2& _vector) const;

    public:
        WNPoint2 mLocation;
        WN_FLOAT32 mRadius;
    };
}

#endif // __WN_MATH_CIRCLE_H__